
package genealogy.deprecated.datamodel.pedigree;

import genealogy.deprecated.datamodel.pedigree.visitors.IPedigreeVisitor;

import java.io.Serializable;

/**
 * @author Steve
 * @invariant 
 */
@Deprecated
public enum Gender implements IPedigreeVisitable, Serializable{
	MALE, FEMALE, UNKNOWN;
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Enum#toString()
	 */
	public String toString(){
		String result = this.name().toLowerCase();	
		return result;	
	}
	
	/**
	 * Returns a character representation of the gender.
	 * @return M=male, F=female, ?=unknown
	 */
	public char toChar(){
		char c = this.name().charAt(0);
		if(c == 'U'){
			c = '?';
		}	
		return c;
	}

	/* (non-Javadoc)
	 * @see genealogy.datamodel.pedigree.IPedigreeVisitable#accept(genealogy.datamodel.pedigree.visitors.AbstractPedigreeVisitor)
	 */
	public void accept(IPedigreeVisitor visitor) {
		visitor.visit(this);
		visitor.endVisit();
	}
	
}
